<%@ page import="view.MediaInfo" %>
<%@ page import="model.filemanager.*" %>
<%@ page import="java.util.List" %>
<%@ page import="com.google.appengine.api.datastore.DatastoreService" %>
<%@ page import="com.google.appengine.api.datastore.DatastoreServiceFactory" %>
<%@ page import="com.google.appengine.api.datastore.Key" %>
<%@ page import="com.google.appengine.api.datastore.KeyFactory" %>
<%@ page import="com.google.appengine.api.datastore.Entity" %>
<%@ page import="com.google.appengine.api.datastore.EntityNotFoundException" %>
<%@ page import="com.google.appengine.api.blobstore.BlobKey" %>
<%@ page import="com.google.appengine.api.blobstore.BlobstoreService" %>
<%@ page import="com.google.appengine.api.blobstore.BlobstoreServiceFactory" %>
<%@ page import="com.google.appengine.api.blobstore.BlobInfo" %>
<%@ page import="com.google.appengine.api.blobstore.BlobInfoFactory" %>
<%@ page import="com.google.appengine.api.images.ImagesServiceFactory" %>
<%@ page import="com.google.appengine.api.images.ImagesService" %>
<%@ page import="com.google.appengine.api.users.User" %>
<%@ page import ="com.google.appengine.api.users.UserService" %>
<%@ page import ="com.google.appengine.api.users.UserServiceFactory" %>

<%
	UserService userService = UserServiceFactory.getUserService();
	User user = userService.getCurrentUser();
    FileManager fm = new FileManager(user.getEmail());
	DatastoreService datastore = DatastoreServiceFactory.getDatastoreService();
%>

<div id="info_content">
	<div id="info_details">
	<% MediaFile file = fm.GetFile(request.getParameter("key")); %>
	<div id="info_regform">
		<%= MediaInfo.GenerateForm(file, file.getType(), false) %>
	<a id="info_editbutton" class="reg_button" onclick="javascript:info_toggle()" href="#">edit info</a>
	<a class="reg_button" href="deletefile?key=<%=file.getKey() %>">delete file</a>
	</div>
	<div id="info_editform">
		<%= MediaInfo.GenerateForm(file, file.getType(), true) %>
	</div>
	
	</div>
	
</div>
